package net.godcode.olivenotes.services.security;

import net.godcode.olivenotes.entities.User;

/**
 * UserAuthenticator provides an interface for authenticating a user
 * within the application.
 * 
 * @author Chris Lewis Jan 5, 2008 <chris@thegodcode.net>
 * @version $Id: UserAuthenticator.java 12 2008-01-05 14:22:07Z burningodzilla $
 */
public interface UserAuthenticator {
	
	/**
	 * Authenticate a user.
	 * @param userName
	 * @param password
	 * @return
	 * @throws IllegalArgumentException if <code>userName</code> is <code>null</code>
	 * an empty string.
	 * @throws PasswordMismatchException if the <code>userName</code> exists,
	 * but the password does not match.
	 * @throws NoSuchUserException if <code>userName</code> does not exist.
	 */
	public User authenticate(String userName, String password);
	
	public User logout();
	
	public boolean isLoggedIn();
	
}